In the prior art, float switches for water pumps use mechanical switches. Generally, the mechanical switches are not good in sealing property and not long in service life. The complex mechanical structures are not ideal in reliability. Products are poor in waterproof performance, the misgiving about the situation that moisture may enter into the products can not be completely avoided, and the metal oxidation phenomenon may occur. The products are complex in production and mounting and high in fraction defective and scrappage rate so as to cause the high cost of the products.